package com.brillilab.service.module.message.template.impl.reagent;

import com.brillilab.service.module.message.template.AbstractMessageTemplate;
import com.brillilab.service.module.message.template.enums.MessageTypeEnum;
import lombok.Data;

/**
 * @author zlb
 * @Title: ReagentAvailableWarnTemp
 * @ProjectName brill_lab
 * @Description: 试剂可用量触发预警值时
 * @date 2019/5/27 17:19
 */
@Data
public class ReagentAvailableWarnTemp extends AbstractMessageTemplate {
    private String labName;
    private String reagentName;
    private String warnValue;

    /**
     * 试剂可用量触发预警值时
     *
     * @param labId       实验室Id
     * @param receiverId  接收人Id
     * @param labMemberId 接收者实验室成员Id
     * @param labName     分享用户姓名
     * @param reagentName 试剂存储路径
     * @param warnValue   试剂名称
     * @param referId     业务关联Id
     */
    public ReagentAvailableWarnTemp(Long labId, Long receiverId, Long labMemberId, String labName, String reagentName, String warnValue, Long referId) {
        super(labId, receiverId);
        super.setType(MessageTypeEnum.ReagentAvailableWarn.getValue());
        super.setTitle("注意，试剂可用量已低于预警值！");
        String content = String.format(
                "<span style='color:#F6AC2D'>%s</span>" + "<span>内的</span>" +
                "<span style='color:#F6AC2D'>%s</span>" + "<span>已低于预警值</span>" +
                "<span style='color:#F6AC2D'>%s</span>",
                labName, reagentName, warnValue);
        super.setContent(content);
        super.setAppContent(String.format(
                "%s内的%s已低于预警值%s",labName, reagentName, warnValue));
        this.labMemberId = labMemberId;
        this.labName = labName;
        this.reagentName = reagentName;
        this.warnValue = warnValue;
        this.referId = referId;
    }

}
